package com.example.springcloudfeignprovider02.controller;

import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author X.I.O
 * @title: FeignController
 * @projectName spring-cloud-1
 * @description: TODO
 * @date 2021/11/7 13:52
 */
@RestController
public class FeignController {

    @GetMapping("/welcome")
    public String testWelcomeController(){
        return "你访问到我了,我是服务调用者2";
    }

    @PostMapping(value = "/test-url-1")
    public JSONObject testJSONObject(@RequestBody Map<String, Object> map){
        map.put("msg","我是服务调用者2");
        JSONObject obj=new JSONObject();
        obj.put("data",map);
        return obj;
    }
}
